<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <h1>青春不常在，抓紧谈恋爱</h1>
    <form >
        <label >性别：</label>
        <input type="radio" name="gender" value="male"> 男
        <input type="radio" name="gender" value="femal"> 女
        
        <br><br>
        <label >生日：</label>
        <label for="year">年份：</label>
<select id="year"></select>

<label for="month">月份：</label>
<select id="month"></select>

<label for="day">日期：</label>
<select id="day"></select>

<script>
    // 获取当前年份
    const currentYear = new Date().getFullYear();

    // 生成年份
    let yearSelect = document.getElementById("year");
    for (let i = currentYear; i >= 1900; i--) {
        let option = document.createElement("option");
        option.value = i;
        option.text = i;
        yearSelect.appendChild(option);
    }

    // 生成月份
    let monthSelect = document.getElementById("month");
    for (let i = 1; i <= 12; i++) {
        let option = document.createElement("option");
        option.value = i;
        option.text = i;
        monthSelect.appendChild(option);
    }

    // 生成日期（默认 31 天）
    let daySelect = document.getElementById("day");
    function populateDays() {
        daySelect.innerHTML = ""; // 清空已有选项
        let selectedYear = parseInt(yearSelect.value);
        let selectedMonth = parseInt(monthSelect.value);
        let daysInMonth = new Date(selectedYear, selectedMonth, 0).getDate(); // 获取该月份的天数

        for (let i = 1; i <= daysInMonth; i++) {
            let option = document.createElement("option");
            option.value = i;
            option.text = i;
            daySelect.appendChild(option);
        }
    }

    // 监听年份和月份的变化，动态更新日期
    yearSelect.addEventListener("change", populateDays);
    monthSelect.addEventListener("change", populateDays);

    // 初始化日期（默认当前年月）
    yearSelect.value = currentYear;
    monthSelect.value = new Date().getMonth() + 1;
    populateDays();
</script>
<br><br>
        <label >所在地区:</label>
        <input type="text" name="location" placeholder="请输入您的城市">
        <br><br>
        <label >婚姻状况：</label>
        <input type="radio" name="marriage" value="未婚"> 未婚
        <input type="radio" name="marriage" value="已婚"> 已婚
        <input type="radio" name="marriage" value="离婚"> 离婚
        <br><br>
        <label >学历：</label>
        <input type="text" name="education" placeholder="请输入您的学历">
        <br><br>
        <label >喜欢的类型：</label>
        <div class="checkbox-group">
            <label><input type="checkbox" name="type" value="妖娆的"> 妖娆的</label>
            <label><input type="checkbox" name="type" value="可爱的"> 可爱的</label>
            <label><input type="checkbox" name="type" value="小鲜肉"> 小鲜肉</label>
            <label><input type="checkbox" name="type" value="老腊肉"> 老腊肉</label>
            <label><input type="checkbox" name="type" value="都喜欢"> 都喜欢</label>
        </div>
        <br>
        <table>
            <tr>
                <td><label for="intro">个人介绍：</label></td>
                <td><textarea id="intro" placeholder="简单介绍一下自己" rows="4" cols="30"></textarea></td>
            </tr>
            <tr>
                <td></td>
                <td><button>免费注册</button></td>
            </tr>
            <tr>
                <td></td>
                <td>
                    <input type="checkbox" id="agree">
                    <label for="agree">我同意注册条款和会员加入标准</label>
                </td>
            </tr>
            <tr>
                <td></td>
                <td><a href="https://search.bilibili.com/all?vt=24405839&keyword=%E6%80%AA%E7%89%A9%E7%8C%8E%E4%BA%BA%E8%8D%92%E9%87%8E%E9%93%B3%E6%9E%AA&from_source=webtop_search&spm_id_from=333.1007&search_source=2">我是会员，立即登录</a></td>
            </tr>

            <tr>
                <td></td>
                <td>我承诺</td>
            </tr>
            <tr>
                <td></td>
                <td><ul><li>年满18岁，单身</li></ul></td>
            </tr>
            <tr>
                <td></td>
                <td><ul><li>抱着严肃的态度</li></ul></td>
            </tr>
            <tr>
                <td></td>
                <td><ul><li>真诚寻找另一半</li></ul></td>
            </tr>
        </table>
        <br>
        <h3></h3>
 

    </form>
    
</body>
</html>